package com.song.shop.niuke;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * /a/b/../c/./d
 *
 * /a/c/d
 */
public class Main {

    public static List<String> test(String str){
        if (str == null || !str.startsWith("/")){
            return null;
        }

        List<String> result = new ArrayList<>();
        String[] split = str.split("/");
        for (int i = 1; i< split.length; i++){
            if (".".equals(split[i])){

            }else if ("..".equals(split[i])){
                if (!result.isEmpty()){
                    result.remove(result.size() -1 );
                }
            }else {
                result.add(split[i]);
            }
        }
        return result;
    }

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String target = scanner.nextLine();
        List<String> test = test(target);
        StringBuilder sb = new StringBuilder("/");
        if (test != null){
            for(int i = 0; i< test.size(); i++){
                sb.append(test.get(i));
                if (i != test.size() - 1){
                    sb.append("/");
                }
            }
        }
        System.out.println(sb.toString());
    }
}
